﻿using MediatR;
using StoreIGet.Applications.Command;
using StoreIModels;
using StoreRepositorys.Interface;

namespace StoreIGet.Applications.CommandHandler
{
    /// <summary>
    /// 上传图片反填
    /// </summary>
    public class PictureBackCommandler : IRequestHandler<PictureBackCommand, PictureModel>
    {
        public readonly IPictureRepository _pictureRepository;
        public PictureBackCommandler(IPictureRepository pictureRepository)
        {
            _pictureRepository = pictureRepository;
        }

        public async Task<PictureModel> Handle(PictureBackCommand request, CancellationToken cancellationToken)
        {
            return await _pictureRepository.GetModelasync(request.PictureId);
        }
    }
}
